const getParam = (name: string, href: string) => {
  const after = href.split('?')[1]
  if (after) {
    const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`)
    const r = after.match(reg)
    if (r != null) {
      return decodeURIComponent(r[2])
    }
    return null
  }
  return null
}
 export default getParam
